<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="智红的博客">
    <meta name="keyword"  content="智红">
    <link rel="shortcut icon" href="/img/favicon.ico">

    <title>
        
        hexo安装 - 智红的博客
        
    </title>

    <!-- Custom CSS -->
    
<link rel="stylesheet" href="/css/aircloud.css">

    
<link rel="stylesheet" href="/css/gitment.css">

    <!--<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">-->
    <link href="//at.alicdn.com/t/font_620856_pl6z7sid89qkt9.css" rel="stylesheet" type="text/css">
    <!-- ga & ba script hoook -->
    <script></script>
<meta name="generator" content="Hexo 5.3.0"></head>

<body>

<div class="site-nav-toggle" id="site-nav-toggle">
    <button>
        <span class="btn-bar"></span>
        <span class="btn-bar"></span>
        <span class="btn-bar"></span>
    </button>
</div>

<div class="index-about">
    <i> 好记性不如烂键盘呐 </i>
</div>

<div class="index-container">
    
    <div class="index-left">
        
<div class="nav" id="nav">
    <div class="avatar-name">
        <div class="avatar ">
            <img src="/img/avatar.jpg" />
        </div>
        <div class="name">
            <i>Zhihong Li</i>
        </div>
    </div>
    <div class="contents" id="nav-content">
        <ul>
            <li >
                <a href="/">
                    <i class="iconfont icon-shouye1"></i>
                    <span>主页</span>
                </a>
            </li>
            <li >
                <a href="/tags">
                    <i class="iconfont icon-biaoqian1"></i>
                    <span>标签</span>
                </a>
            </li>
            <li >
                <a href="/archive">
                    <i class="iconfont icon-guidang2"></i>
                    <span>存档</span>
                </a>
            </li>
            <li >
                <a href="/about/">
                    <i class="iconfont icon-guanyu2"></i>
                    <span>关于</span>
                </a>
            </li>
            
            <li>
                <a id="search">
                    <i class="iconfont icon-sousuo1"></i>
                    <span>搜索</span>
                </a>
            </li>
            
        </ul>
    </div>
    
        <div id="toc" class="toc-article">
    <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#hexo%E5%AE%89%E8%A3%85"><span class="toc-text">hexo安装</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-Aircloud-Blog-A-DEMO-For-Hexo-Theme-AirCloud"><span class="toc-text">Hexo-Aircloud-Blog: A DEMO For Hexo-Theme-AirCloud</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F"><span class="toc-text">使用方式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE"><span class="toc-text">配置</span></a></li></ol></li></ol>
</div>
    
</div>


<div class="search-field" id="search-field">
    <div class="search-container">
        <div class="search-input">
            <span id="esc-search"> <i class="icon-fanhui iconfont"></i></span>
            <input id="search-input"/>
            <span id="begin-search">搜索</span>
        </div>
        <div class="search-result-container" id="search-result-container">

        </div>
    </div>
</div>

        <div class="index-about-mobile">
            <i> 好记性不如烂键盘呐 </i>
        </div>
    </div>
    
    <div class="index-middle">
        <!-- Main Content -->
        


<div class="post-container">
    <div class="post-title">
        hexo安装
    </div>

    <div class="post-meta">
        <span class="attr">发布于：<span>2020-06-03 14:11:31</span></span>
        
        <span class="attr">标签：/
        
        <a class="tag" href="/tags/#hexo" title="hexo">hexo</a>
        <span>/</span>
        
        
        </span>
        <span class="attr">访问：<span id="busuanzi_value_page_pv"></span>
</span>
</span>
    </div>
    <div class="post-content no-indent">
        <h1 id="hexo安装"><a href="#hexo安装" class="headerlink" title="hexo安装"></a>hexo安装</h1><h2 id="Hexo-Aircloud-Blog-A-DEMO-For-Hexo-Theme-AirCloud"><a href="#Hexo-Aircloud-Blog-A-DEMO-For-Hexo-Theme-AirCloud" class="headerlink" title="Hexo-Aircloud-Blog: A DEMO For Hexo-Theme-AirCloud"></a>Hexo-Aircloud-Blog: A DEMO For <a target="_blank" rel="noopener" href="https://github.com/aircloud/hexo-theme-aircloud">Hexo-Theme-AirCloud</a></h2><blockquote>
<p><a target="_blank" rel="noopener" href="http://niexiaotao.cn/">预览地址</a></p>
</blockquote>
<h2 id="使用方式"><a href="#使用方式" class="headerlink" title="使用方式"></a>使用方式</h2><p>ubuntu 16.04 nodejs 版本低会出现</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">/usr/<span class="built_in">local</span>/lib/node_modules/npm/bin/npm-cli.js:79</span><br><span class="line"><span class="built_in">let</span> notifier = require(<span class="string">&#x27;update-notifier&#x27;</span>)(&#123;pkg&#125;)</span><br><span class="line">^^^</span><br><span class="line"></span><br><span class="line">SyntaxError: Block-scoped declarations (<span class="built_in">let</span>, const, <span class="keyword">function</span>, class) not yet supported outside strict mode</span><br><span class="line">at exports.runInThisContext (vm.js:53:16)</span><br><span class="line">at Module._compile (module.js:374:25)</span><br><span class="line">at Object.Module._extensions..js (module.js:417:10)</span><br><span class="line">at Module.load (module.js:344:32)</span><br><span class="line">at Function.Module._load (module.js:301:12)</span><br><span class="line">at Function.Module.runMain (module.js:442:10)</span><br><span class="line">at startup (node.js:136:18)</span><br><span class="line">at node.js:966:3</span><br></pre></td></tr></table></figure>
<p>先卸载nodejs，然后安装稳定最新版</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get remove --purge nodejs</span><br><span class="line">curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -</span><br><span class="line">sudo apt-get update</span><br><span class="line">sudo apt-get install nodejs</span><br><span class="line">sudo npm install npm -g</span><br><span class="line">npm --version</span><br></pre></td></tr></table></figure>
<p>安装hexo</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo npm install</span><br><span class="line">sudo npm install -g hexo-cli</span><br></pre></td></tr></table></figure>
<p>至此安装完毕</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git clone https:&#x2F;&#x2F;github.com&#x2F;aircloud&#x2F;hexo-aircloud-blog.git --recursive</span><br><span class="line">cd hexo-aircloud-blog</span><br><span class="line">git clone https:&#x2F;&#x2F;github.com&#x2F;aircloud&#x2F;hexo-theme-aircloud.git themes&#x2F;aircloud</span><br><span class="line">npm install</span><br><span class="line">hexo serve</span><br></pre></td></tr></table></figure>
<p>然后打开 <a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000/</a> 即可。</p>
<h2 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h2><p>可以直接修改 _config.yml 进行自定义配置。如果在配置过程中存在疑问，可以在<a target="_blank" rel="noopener" href="https://github.com/aircloud/hexo-aircloud-blog/issues">这里</a>进行提出</p>

        
        <br />
        <div id="comment-container">
        </div>
        <div id="disqus_thread"></div>

        <div id="lv-container">
        </div>

    </div>
</div>

    </div>
</div>


<footer class="footer">
    <ul class="list-inline text-center">
        
        

        

        

        

        

    </ul>
    
    <p>
        <span id="busuanzi_container_site_pv">
            <span id="busuanzi_value_site_pv"></span>PV
        </span>
        <span id="busuanzi_container_site_uv">
            <span id="busuanzi_value_site_uv"></span>UV
        </span>
        Created By <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>  Theme <a target="_blank" rel="noopener" href="https://github.com/aircloud/hexo-theme-aircloud">AirCloud</a></p>
</footer>




</body>

<script>
    // We expose some of the variables needed by the front end
    window.hexo_search_path = "search.json"
    window.hexo_root = "/"
    window.isPost = true
</script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>

<script src="/js/index.js"></script>

<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




</html>
